module.exports = {
  devServer: {
    port: 8081,
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        ws: true,
        logLevel: 'debug',
        onProxyReq(proxyReq, req, res) {
          console.log(`代理请求: ${req.method} ${req.path}`);
        },
        onProxyRes(proxyRes, req, res) {
          console.log(`代理响应: ${proxyRes.statusCode} ${req.method} ${req.path}`);
        },
        onError(err, req, res) {
          console.error('代理错误:', err);
        }
      }
    }
  }
} 